<template>
	<view>
		<view class="bg">
			<view class="display-a">
				<view class="name">{{cardsettings.cardType == 1 ? '折扣券' : cardsettings.cardType == 2 ? '满减券' : cardsettings.cardType == 3 ? '礼品券' : '红包券'}}</view>
				<view style="margin-left: 56rpx;">
					<view class="font-size_32rpx font-weight_bold margin-bottom_20rpx">{{cardsettings.cardType == 1 ? '折扣券' : cardsettings.cardType == 2 ? '满减券' : cardsettings.cardType == 3 ? '礼品券' : '红包券'}}</view>
					<view class="color_999999 font-size_26rpx">核销有效期 {{cardsettings.checkEndTime}}</view>
				</view>
			</view>
			<view class="img-102">
				<scroll-view :scroll-y="true" class="detail">{{obj.activityDescription}}</scroll-view>
			</view>
			<image class="img-103" @click="tips()" src="../../static/103.png"></image>
			<view style="height: 20rpx;"></view>
			<view class="pos-left" @click="tips()">
				<image class="head" src=""></image>
				<view class="pos-name font-overflow">商家名称</view>
				<view class="pos-but">关注</view>
			</view>
			<!-- <view class="pos-right">我的奖品</view> -->
			<!-- <image class="img-31" @click="tips()" src="../../static/31.png"></image> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				obj: {},
				cardsettings: {},
			}
		},
		
		onLoad(options) {
			if (options.id){
				this.id = options.id;
				this.detail();
			}
		},
		
		onShow() {
			
		},
		
		methods: {
			
			//活动详情
			async detail() {
				const result = await this.$http.get({
					url: this.$api.selectGetId,
					data: {
						id: this.id,
					}
				});
				if (result.code == 2000) {
					this.obj = result.data;
					this.cardsettings = result.data.cardsettings;
				} else {
					this.$sun.toast(result.msg, 'none');
				}
			},
			
			tips() {
				this.$sun.toast("此页面为活动预览页!",'none');
			},
			
		}
	}
</script>

<style lang="scss">
	
	.pos-right {
		width: 150rpx;
		text-align: center;
		background: rgba(0, 0, 0, 0.40);
		border-radius: 200rpx 0px 0px 200rpx;
		color: #FFFFFF;
		position: fixed;
		top: 40rpx;
		right: 0;
		z-index: 9;
		padding: 10rpx 0;
	}
	
	.pos-but {
		width: 80rpx;
		border-radius: 36rpx;
		background-color: #FFBC00;
		color: #FFFFFF;
		font-size: 24rpx;
		text-align: center;
		padding: 10rpx;
	}
	
	.pos-name {
		width: 160rpx;
		color: #FFFFFF;
	}
	
	.head {
		width: 64rpx;
		height: 64rpx;
		border-radius: 50%;
		background-color: #aaaaaa;
		margin-right: 14rpx;
	}
	
	.pos-left {
		width: 320rpx;
		background: rgba(0, 0, 0, 0.40);
		border-radius: 60rpx;
		z-index: 9;
		position: fixed;
		top: 40rpx;
		left: 20rpx;
		display: flex;
		align-items: center;
	}
	
	.detail {
		padding: 170rpx 40rpx 20rpx 40rpx;
		height: 320rpx;
		width: 600rpx;
	}
	
	.img-103 {
		width: 510rpx;
		height: 108rpx;
		margin-left: 120rpx;
	}
	
	.img-102 {
		width: 674rpx;
		height: 534rpx;
		background: url('~static/102.png');
		background-repeat: no-repeat;
		background-size: contain;
		margin: 120rpx 38rpx 30rpx 38rpx;
	}
	
	.img-31 {
		width: 578rpx;
		height: 136rpx;
		margin: 198rpx 86rpx 0;
	}
	
	.name {
		width: 24rpx;
		text-align: center;
		color: #FFFFFF;
		font-size: 24rpx;
		margin-left: 166rpx;
	}
	
	.bg {
		width: 750rpx;
		height: 1662rpx;
		background: url('~static/101.png');
		background-repeat: no-repeat;
		background-size: contain;
		padding: 690rpx 0 0 0;
	}
	
	page {
		border-top: 0 ;
		background-color: #FF9C72;
	}
	
</style>
